package com.freshcity.tree
{
	import com.freshcity.lib.tooltip.ToolTipsManager;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	
	public class WaterItem extends MovieClip
	{
		public var markIcon:DisplayObject;
		
		private var _category:int;
		private var _toolTipData:String;
		private var _tipDesc:Array;
		private var _filter:GlowFilter;
		private var _index:int;
		private var _mark:Boolean;
		
		public function WaterItem(index:int,category:int,xpos:Number=0.0,ypos:Number=0.0)
		{
			this._index=index;
			this.x = xpos;
			this.y = ypos;
			
			
			this._tipDesc=["空的水槽","井水(+5)","河水(+10)","露水(+20)",
				"雨水(+40)","山泉水(+80)"];
			
			this.category = category;
			this.buttonMode=true;
			this.width=15;
			this.height=24;
			this.mark=false;
			
			this.gotoAndStop(_category+1);
			ToolTipsManager.register(this);
		}
		
		public function destroy():void
		{
			ToolTipsManager.unregister(this);
		}
		
		public function get toolTipData():*
		{
			return _tipDesc[(_category)];
		}

		public function get index():int
		{
			return _index;
		}

		public function set index(value:int):void
		{
			_index = value;
		}

		public function get category():int
		{
			return _category;
		}

		public function set category(value:int):void
		{
			_category = value;
		}

		public function get mark():Boolean
		{
			return _mark;
		}

		public function set mark(value:Boolean):void
		{
			_mark = value;
			markIcon.visible=value;
		}


	}
}